﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using QuanLyHocSinh.HeThongXuLy;

namespace QuanLyHocSinh.HeThongLuuTru
{
    class NguoiDungDAO
    {
        public static bool KiemTraNguoiDung(NguoiDungDTO user) 
        { 
            string sql = "select * from NGUOIDUNG where TenNguoiDung = '" + user.TenNguoiDung + "' and MatKhauNguoiDung = '" + user.MatKhau + "'";
            DataTable dt = DataAccess.ExecQuery(sql); 
            if (dt.Rows.Count != 0)
            { 
                return true;
            }
            else 
            {
                return false;
            }
        }
        public static DataTable LayDanhSachNguoiDung()
        { 
            string sql = "Select * from NGUOIDUNG";
            return DataAccess.ExecQuery(sql);
        }
    }
}
